package com.hall.service;

import com.hall.dao.UserMapper;
import com.hall.pojo.RegisterVo;
import com.hall.pojo.SysUser;
import com.hall.pojo.SysUserPermission;
import com.hall.pojo.UserLogin;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class UserServiceImpl implements UserService{
    @Autowired
    private UserMapper userMapper;
    @Override
    public SysUser checkLogin(UserLogin userLogin) {
        SysUser su1 =userMapper.checkLogin(userLogin);
        return su1;
    }

    @Override
    public SysUser checkLoginByPhone(UserLogin userLogin2) {
        return userMapper.checkLoginByPhone(userLogin2);
    }

    @Override
    public SysUser selectUsername(RegisterVo registerVo) {
        return userMapper.CheckupUsername(registerVo);
    }

    @Override
    public SysUser selectPhone(RegisterVo registerVo) {
        return userMapper.CheckupPhone(registerVo);
    }

    @Override
    public int addUser(SysUser sysUser) {
        return userMapper.addUser(sysUser);
    }

    @Override
    public SysUser getUser(String id) {
        return userMapper.getUser(id);
    }

    @Override
    public SysUserPermission userPermission(String userId) {
        return userMapper.userPermission(userId);
    }

    @Override
    public boolean addUserPermission(SysUserPermission sysUserPermission) {
        return userMapper.addUserPermission(sysUserPermission)>0;
    }

    @Override
    public List<SysUser> allUser() {
        return userMapper.allUser();
    }

    public void setUserMapper(UserMapper userMapper) {
    }

}
